# Maintainer: Frederik Schwan <freswa at archlinux dot org>

pkgname=perl-json-webtoken
pkgver=0.10
pkgrel=8
pkgdesc='Perl/CPAN module JSON WebToken'
arch=('any')
url='https://metacpan.org/release/JSON-WebToken'
license=('GPL')
depends=('perl-json')
makedepends=('perl-module-build' 'perl-module-runtime')
checkdepends=('perl-test-mock-guard' 'perl-test-requires')
options=('!emptydirs' purge)
source=("https://cpan.metacpan.org/authors/id/X/XA/XAICRON/JSON-WebToken-${pkgver}.tar.gz")
b2sums=('823f09e7d0c2d325de19c0d0f1204d1d0573407978c6d86119e052264c16d8c81a49ee74a9551bcbbe8f054916cd02236e4fb8f0c26ee5e539b71e1a30cdceb6')

build() {
  cd JSON-WebToken-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 MODULEBUILDRC=/dev/null
  perl Build.PL
  ./Build
}

check() {
  cd JSON-WebToken-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1
  ./Build test
}

package(){
  cd JSON-WebToken-${pkgver}
  unset PERL5LIB PERL_MM_OPT PERL_MB_OPT PERL_LOCAL_LIB_ROOT
  ./Build install --installdirs=vendor --destdir="${pkgdir}"
}
